<?php 
## include required files
/*******************************/
require_once '../../includefiles.php';
require_once '../../model/users.php';
require_once '../../model/email.php';
include_once("../../model/trade.php");
include_once("../../model/budget.php");
require_once "../../includes/classes/paging_htacess.php";
require_once '../../redirect.php';

## creating objects of required models
$userObj 		= new Model_Users();
$tradeObj = new Model_TRADE();
$budgetObj = new Model_Budget();



checkUserLogin();

if($_SESSION['user_type'] == '4')
{
	@header("location:".SITE_URL."/");
	exit;
}


$userId =$_SESSION['getbids_id'];


if($_GET['id1'] !='')
{
	$job_id = base64_decode($_GET['id1']);	
	$job_details = $userObj->getJobDetailsById($job_id);
	$getjobtype = $tradeObj->getTradeCategoryDetailsById($job_details['jobtype_id']);	
	$job_details['jobtype_name'] = $getjobtype['trade_category'];
	$budgetdetail = $budgetObj->getBudgetDetailsById($job_details['approx_budget']);
	$job_details['budget_name'] = $budgetdetail['budget_name'];	
	$job_details['message'] = $getuserjobdetail['message'];
	$smarty->assign('job_details', $job_details);
}

/*===========================================================================*/
	$userDetArray = $userObj->getUserDetailsByUserId($userId);
	$smarty->assign("userDetArray", $userDetArray);	
	
/*===========================================================================*/	


if($_SESSION['msg']){
		$smarty->assign("msg", $_SESSION['msg']);
		unset($_SESSION['msg']);
}

$active ="myaccount";
$smarty->assign('active',$active);
$subactive ="myjobs";
$smarty->assign('subactive',$subactive);
$smarty->assign('mainmenu',"4");

$smarty->display(TEMPLATEDIR.'/modules/jobs/viewjob.tpl');
unset($smarty);
?>
